package com.yun.kin.blog.service;

import com.yun.kin.blog.dao.UserRepository;
import com.yun.kin.blog.po.User;
import com.yun.kin.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jin
 * @Description
 * @Date 2021/3/2 17:13
 * 接口实现
 */
@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));

        return user;
    }
}
